const BrowserWindow = require('electron').remote.BrowserWindow
const path = require('path')

export function createNewWindow(pagePath,title,width ,height ) {
    width = width ? width:1000;
    height = height ? height:666;
    const winURL = process.env.NODE_ENV === 'development'
        ? `http://localhost:9080`
        : `file://${__dirname}/index.html`
    const modalPath = winURL+pagePath
    // const modalPath = pagePath;
    let win = new BrowserWindow({ width: width, height: height,title :title })
    win.on('close', function () { win = null })
    win.loadURL(modalPath)
    win.show()
}